{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b41a705c",
   "metadata": {},
   "outputs": [],
   "source": [
    "#调用requests模块（打开Google Chrome浏览器）\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "761a8ff8",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"address\":\"广东省广州市南沙区东涌中学\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "838f8e11",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "311dc214",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市南沙区东涌中学',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '南沙区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440115',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.456483,22.880417',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d60089f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.456483,22.880417'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "东涌中学_location = r.json()['geocodes'][0]['location']\n",
    "东涌中学_location"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "05872ccc",
   "metadata": {},
   "source": [
    "# 逆地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4efe0c3d",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '东涌中学_location' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-5-35adba27c8e9>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      8\u001b[0m payload = {\n\u001b[1;32m      9\u001b[0m     \u001b[0;34m\"key\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\"dfebacc3a57966864984891dbfaddeee\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m     \u001b[0;34m\"location\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0m东涌中学_location\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     11\u001b[0m }\n\u001b[1;32m     12\u001b[0m \u001b[0;31m# 5. 发起请求\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name '东涌中学_location' is not defined"
     ]
    }
   ],
   "source": [
    "# extensions=base（默认）\n",
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"location\":东涌中学_location\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=regeo_url, params=payload)   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "504c2b67",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'r' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-6-d17ca1acc36c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'r' is not defined"
     ]
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "4b6f0d11",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'r' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-7-52b7ec8d97cc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'r' is not defined"
     ]
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "6a18e665",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '东涌中学_location' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-8-2d3e3be294e1>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      8\u001b[0m payload = {\n\u001b[1;32m      9\u001b[0m     \u001b[0;34m\"key\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\"dfebacc3a57966864984891dbfaddeee\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m     \u001b[0;34m\"location\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0m东涌中学_location\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     11\u001b[0m     \u001b[0;34m\"extensions\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\"all\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     12\u001b[0m     \u001b[0;34m\"poitype\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\"true\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name '东涌中学_location' is not defined"
     ]
    }
   ],
   "source": [
    "# extensions=all \n",
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"location\":东涌中学_location,\n",
    "    \"extensions\":\"all\",\n",
    "    \"poitype\":\"true\",\n",
    "    \n",
    "    \n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=regeo_url, params=payload) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "92f6d297",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "6d26535b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'regeocode': {'formatted_address': '广东省广州市南沙区东涌镇东涌中学',\n",
       "  'addressComponent': {'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'city': '广州市',\n",
       "   'citycode': '020',\n",
       "   'district': '南沙区',\n",
       "   'adcode': '440115',\n",
       "   'township': '东涌镇',\n",
       "   'towncode': '440115104000',\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'streetNumber': {'street': '和乐路',\n",
       "    'number': '1号',\n",
       "    'location': '113.455380,22.881142',\n",
       "    'direction': '西北',\n",
       "    'distance': '138.818'},\n",
       "   'businessAreas': [{'location': '113.440056,22.883934',\n",
       "     'name': '东涌',\n",
       "     'id': '440115'}]},\n",
       "  'pois': [{'id': 'B0FFH946DL',\n",
       "    'name': '东涌中学',\n",
       "    'type': '科教文化服务;学校;中学',\n",
       "    'tel': '020-84906128;020-84905501',\n",
       "    'direction': 'Center',\n",
       "    'distance': '0',\n",
       "    'location': '113.456483,22.880417',\n",
       "    'address': '东涌镇和乐路1号',\n",
       "    'poiweight': '0.302539',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B00140MVPW',\n",
       "    'name': '东涌第一小学',\n",
       "    'type': '科教文化服务;学校;小学',\n",
       "    'tel': '020-84908583',\n",
       "    'direction': '东北',\n",
       "    'distance': '228.55',\n",
       "    'location': '113.458302,22.881607',\n",
       "    'address': '东涌镇和乐路2号',\n",
       "    'poiweight': '0.353068',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B00140UD9H',\n",
       "    'name': '万兴花园',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '203.822',\n",
       "    'location': '113.456752,22.882233',\n",
       "    'address': '和乐路4',\n",
       "    'poiweight': '0.415839',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0014061A0',\n",
       "    'name': '广州市南沙区东涌教育指导中心',\n",
       "    'type': '科教文化服务;学校;成人教育',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '289.797',\n",
       "    'location': '113.455086,22.882683',\n",
       "    'address': '东涌镇和乐路6号',\n",
       "    'poiweight': '0.272613',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFG1TOIG',\n",
       "    'name': '恩迹爱心钢琴教室',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '300.541',\n",
       "    'location': '113.458775,22.882104',\n",
       "    'address': '东涌镇万兴路12号',\n",
       "    'poiweight': '0.122055',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFG8O00O',\n",
       "    'name': '金点子教育服务',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '13418069250',\n",
       "    'direction': '东北',\n",
       "    'distance': '340.811',\n",
       "    'location': '113.457986,22.883151',\n",
       "    'address': '东涌镇祥福路7-9号',\n",
       "    'poiweight': '0.171976',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFFPSP0I',\n",
       "    'name': '东涌公园',\n",
       "    'type': '风景名胜;公园广场;公园',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '356.137',\n",
       "    'location': '113.456836,22.883603',\n",
       "    'address': '祥福路1号楼1号铺',\n",
       "    'poiweight': '0.324484',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFFF0KS2',\n",
       "    'name': '东涌镇成人文化技术学校',\n",
       "    'type': '科教文化服务;学校;成人教育',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '358.11',\n",
       "    'location': '113.454400,22.883003',\n",
       "    'address': '和乐一路10号',\n",
       "    'poiweight': '0.394273',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0HBLUC2IW',\n",
       "    'name': '翰林画苑',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '279.829',\n",
       "    'location': '113.458142,22.882416',\n",
       "    'address': '万兴路与祥福街交叉口东南约60米',\n",
       "    'poiweight': '0.186472',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFFRH501',\n",
       "    'name': '广州市欧贤斯贸易有限公司',\n",
       "    'type': '公司企业;公司;商业贸易',\n",
       "    'tel': '18924150681',\n",
       "    'direction': '东北',\n",
       "    'distance': '283.555',\n",
       "    'location': '113.458261,22.882371',\n",
       "    'address': '万兴路22附近',\n",
       "    'poiweight': '0.140674',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFHP54W9',\n",
       "    'name': '东涌文化广场',\n",
       "    'type': '风景名胜;公园广场;城市广场',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '309.576',\n",
       "    'location': '113.454176,22.882215',\n",
       "    'address': '吉祥中街12号',\n",
       "    'poiweight': '0.182439',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFITADRY',\n",
       "    'name': '清桦创意培训',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '15521308846',\n",
       "    'direction': '东北',\n",
       "    'distance': '329.138',\n",
       "    'location': '113.459299,22.881842',\n",
       "    'address': '东涌镇万兴路2-3号',\n",
       "    'poiweight': '0.173211',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0G23B8YF2',\n",
       "    'name': '东涌第一小学(西校区)',\n",
       "    'type': '科教文化服务;学校;小学',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '344.242',\n",
       "    'location': '113.454746,22.883067',\n",
       "    'address': '东涌镇和乐路8号',\n",
       "    'poiweight': '0.301901',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0HKUZUFSQ',\n",
       "    'name': '育才中心扬翔教育',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '13602881328',\n",
       "    'direction': '东北',\n",
       "    'distance': '364.716',\n",
       "    'location': '113.459427,22.882261',\n",
       "    'address': '东涌镇东丽园一巷5号',\n",
       "    'poiweight': '0.187741',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFK1WQF6',\n",
       "    'name': '广州市南沙区文化馆东涌镇分馆',\n",
       "    'type': '科教文化服务;文化宫;文化宫',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '377.869',\n",
       "    'location': '113.454199,22.883085',\n",
       "    'address': '吉祥中路与和乐一路交叉口东50米',\n",
       "    'poiweight': '0.176063',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFK1YIKN',\n",
       "    'name': '东涌镇文化中心',\n",
       "    'type': '科教文化服务;文化宫;文化宫',\n",
       "    'tel': '020-84902318',\n",
       "    'direction': '西北',\n",
       "    'distance': '382.226',\n",
       "    'location': '113.454195,22.883132',\n",
       "    'address': '东涌镇和乐一路29-31号',\n",
       "    'poiweight': '0.176063',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFH07MCU',\n",
       "    'name': '星空少儿运动',\n",
       "    'type': '科教文化服务;培训机构;培训机构|购物服务;体育用品店;体育用品店',\n",
       "    'tel': '18925039891',\n",
       "    'direction': '西北',\n",
       "    'distance': '386.587',\n",
       "    'location': '113.453146,22.882040',\n",
       "    'address': '东涌镇吉祥中街62号',\n",
       "    'poiweight': '0.18078',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFITAEX0',\n",
       "    'name': '佰加教育',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '387.554',\n",
       "    'location': '113.453271,22.882258',\n",
       "    'address': '吉祥中路42号附近',\n",
       "    'poiweight': '0.173211',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0HKLAQ17C',\n",
       "    'name': '荔枝艺术培训中心',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '390.45',\n",
       "    'location': '113.453362,22.882432',\n",
       "    'address': '东涌镇吉祥中街38-40号(东涌中学正对面)',\n",
       "    'poiweight': '0.191174',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFH3RRFL',\n",
       "    'name': '南沙区图书馆(东涌镇分馆)',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': '020-84902318;020-39010982',\n",
       "    'direction': '西北',\n",
       "    'distance': '390.75',\n",
       "    'location': '113.454160,22.883204',\n",
       "    'address': '东涌镇和乐一路10号文化中心3楼',\n",
       "    'poiweight': '0.145934',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFH1YGN1',\n",
       "    'name': '广州游指文化传播有限公司',\n",
       "    'type': '科教文化服务;传媒机构;传媒机构',\n",
       "    'tel': '020-39010869;13450438318',\n",
       "    'direction': '西',\n",
       "    'distance': '393.7',\n",
       "    'location': '113.452856,22.881587',\n",
       "    'address': '吉祥中路与和乐一路交叉口西南200米',\n",
       "    'poiweight': '0.172255',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFI99319',\n",
       "    'name': '勉学教育',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '395.692',\n",
       "    'location': '113.453450,22.882620',\n",
       "    'address': '吉祥中路42号附近',\n",
       "    'poiweight': '0.173771',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFH07MC9',\n",
       "    'name': '佳韵艺术培训中心(吉祥中路店)',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '13268250995',\n",
       "    'direction': '西北',\n",
       "    'distance': '397.197',\n",
       "    'location': '113.453487,22.882684',\n",
       "    'address': '东涌镇吉祥中街28号',\n",
       "    'poiweight': '0.17455',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFLJY4KH',\n",
       "    'name': '升跃教育',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '15521159248;15814828438',\n",
       "    'direction': '西北',\n",
       "    'distance': '398.741',\n",
       "    'location': '113.453520,22.882742',\n",
       "    'address': '东涌吉祥中街32号(东涌文化广场对面)',\n",
       "    'poiweight': '0.185394',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFHN1YN6',\n",
       "    'name': '美师教育',\n",
       "    'type': '科教文化服务;培训机构;培训机构',\n",
       "    'tel': '15374072073',\n",
       "    'direction': '西北',\n",
       "    'distance': '399.349',\n",
       "    'location': '113.453530,22.882761',\n",
       "    'address': '和乐一路19东南50米',\n",
       "    'poiweight': '0.174215',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFFWOUZW',\n",
       "    'name': '鼎鹏',\n",
       "    'type': '公司企业;公司;公司',\n",
       "    'tel': [],\n",
       "    'direction': '西',\n",
       "    'distance': '391.206',\n",
       "    'location': '113.452986,22.881830',\n",
       "    'address': '吉祥中路与和乐一路交叉口西南约160米',\n",
       "    'poiweight': '0.187386',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFG8IR9W',\n",
       "    'name': '创新烧腊店',\n",
       "    'type': '餐饮服务;快餐厅;快餐厅',\n",
       "    'tel': '020-39011079',\n",
       "    'direction': '东北',\n",
       "    'distance': '380.792',\n",
       "    'location': '113.459694,22.882142',\n",
       "    'address': '东涌镇培贤东路28号之三',\n",
       "    'poiweight': '0.209449',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0HDGCOQ9I',\n",
       "    'name': '峰萍熟食店',\n",
       "    'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "    'tel': '15986406277',\n",
       "    'direction': '西北',\n",
       "    'distance': '390.671',\n",
       "    'location': '113.453422,22.882512',\n",
       "    'address': '吉祥中路东涌文化广场西北侧',\n",
       "    'poiweight': '0.209897',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B0FFFWO959',\n",
       "    'name': '喜乐台湾美食休闲坊',\n",
       "    'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "    'tel': '18925147765',\n",
       "    'direction': '西北',\n",
       "    'distance': '389.499',\n",
       "    'location': '113.453140,22.882085',\n",
       "    'address': '东涌镇吉祥中街60号',\n",
       "    'poiweight': '0.199652',\n",
       "    'businessarea': '东涌'},\n",
       "   {'id': 'B00141SXNS',\n",
       "    'name': '中国太平洋保险',\n",
       "    'type': '金融保险服务;金融保险服务机构;金融保险机构',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '391.377',\n",
       "    'location': '113.458263,22.883531',\n",
       "    'address': '东涌镇东兴三路15号',\n",
       "    'poiweight': '0.361044',\n",
       "    'businessarea': '东涌'}],\n",
       "  'roads': [{'id': '020F49F0140442661',\n",
       "    'name': '和乐一路',\n",
       "    'direction': '西南',\n",
       "    'distance': '130.663',\n",
       "    'location': '113.457,22.8815'},\n",
       "   {'id': '020F49F014044384',\n",
       "    'name': '和乐路',\n",
       "    'direction': '东南',\n",
       "    'distance': '146.564',\n",
       "    'location': '113.456,22.8816'},\n",
       "   {'id': '020F49F0140442557',\n",
       "    'name': '万兴一巷',\n",
       "    'direction': '西南',\n",
       "    'distance': '165.262',\n",
       "    'location': '113.457,22.8818'}],\n",
       "  'roadinters': [{'direction': '南',\n",
       "    'distance': '156.79',\n",
       "    'location': '113.456362,22.881822',\n",
       "    'first_id': '020F49F0140442661',\n",
       "    'first_name': '和乐一路',\n",
       "    'second_id': '020F49F014044384',\n",
       "    'second_name': '和乐路'}],\n",
       "  'aois': [{'id': 'B0FFH946DL',\n",
       "    'name': '东涌中学',\n",
       "    'adcode': '440115',\n",
       "    'location': '113.456483,22.880417',\n",
       "    'area': '77291.796975',\n",
       "    'distance': '0',\n",
       "    'type': '141202'}]}}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0a5be2df",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5215c0a2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "de53b1cd",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'r' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-4-8ee9f28fe791>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson_normalize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'regeocode'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'pois'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'r' is not defined"
     ]
    }
   ],
   "source": [
    "pd.json_normalize(r.json())['regeocode']['pois'].T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "484fdb94",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4a154435",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0b430e92",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.678280,23.628439'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import requests\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"address\":\"广东省广州市从化区广州南方学院\"\n",
    "}\n",
    "r = requests.get(url=geo_url, params=payload)\n",
    "广州南方学院_location = r.json()['geocodes'][0]['location']\n",
    "广州南方学院_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "590ea231",
   "metadata": {},
   "outputs": [],
   "source": [
    "around_url = 'https://restapi.amap.com/v3/place/around?parameters'\n",
    "\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"location\":广州南方学院_location,\n",
    "    \"keywords\":\"中餐厅,西餐厅,快餐厅\"\n",
    "}\n",
    "r = requests.get(around_url,params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "3eac5ce1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '276',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031',\n",
       "   'distance': '408',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '猪杂汤饭',\n",
       "   'location': '113.676500,23.631722',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3FCLIZ4'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇龙岗圩桃园西路19号之一',\n",
       "   'distance': '3376',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '13.00',\n",
       "    'opentime2': [],\n",
       "    'rating': '4.3',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/27963d4e18494d57cda33634f543a3ba'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '得道正果云吞(龙岗店)',\n",
       "   'location': '113.666743,23.600006',\n",
       "   'tel': '15918578003',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFGBO437'},\n",
       "  {'parent': [],\n",
       "   'address': '新城南路与新城西路交叉口东北约180米',\n",
       "   'distance': '11184',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '4.1',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2a412a809f314e932e86d2b7386da6cc'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '海玲美食店',\n",
       "   'location': '113.732107,23.715982',\n",
       "   'tel': '13725210972',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKSHL4O'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁中路5号',\n",
       "   'distance': '12523',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '7.00',\n",
       "    'opentime2': [],\n",
       "    'rating': '4.5',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅|生活服务;生活服务场所;生活服务场所',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/48f705655d1baf8ff8c66fd7c96586ee'}],\n",
       "   'typecode': '050100|070000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '坚记联兴牛腩粉(西宁店)',\n",
       "   'location': '113.590445,23.549844',\n",
       "   'tel': '13168372713;13570471103',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFH8B44L'},\n",
       "  {'parent': [],\n",
       "   'address': '',\n",
       "   'distance': '12570',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '12.00',\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/59071e807a4877f997081393aa9fb310'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '增城区',\n",
       "   'name': '猪杂粥窝篮粉',\n",
       "   'location': '113.774541,23.557948',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0014247L7'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁中路24号',\n",
       "   'distance': '12596',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '12.00',\n",
       "    'opentime2': [],\n",
       "    'rating': '4.2',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/fb6a8d7c19d5c8ddfdea4aceb36d81fd'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ad87af982abf5e7d73cea710df054235'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '西宁面店',\n",
       "   'location': '113.589241,23.550039',\n",
       "   'tel': '020-82972968',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140I277'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁中路93号(即西街市场旁)',\n",
       "   'distance': '12615',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': '09:00-21:00',\n",
       "    'rating': '4.1',\n",
       "    'open_time': '09:00-21:00',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/f7f13e8907f6dec732a5acf1d91a17e2'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55b5b705a31058fe016b4215'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/fcb13908e78cb54a9372fd8c3b7d1826'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '宝华食店(村前路)',\n",
       "   'location': '113.588354,23.550648',\n",
       "   'tel': '13828437329',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140H6MD'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁中路85号',\n",
       "   'distance': '12621',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '23.00',\n",
       "    'opentime2': '周一至周日:07:00-19:00',\n",
       "    'rating': '4.4',\n",
       "    'open_time': '07:00-19:00',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/960710539f3766353dffd0be65bba79d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/50be4fa9e9c45f1f707a208f879b33e5'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/67364a943c200a701025885b719c3172'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '粤饺皇(西街店)',\n",
       "   'location': '113.587903,23.551004',\n",
       "   'tel': '13650952135;18689436339',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFGF26NC'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁路西街市场路口',\n",
       "   'distance': '12661',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '32.00',\n",
       "    'opentime2': [],\n",
       "    'rating': '4.1',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'photos': [{'title': '产品图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/19f5aad870669318d259f90d76048f4f'},\n",
       "    {'title': '产品图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/8d12e9e625616434bfbe778b167b4419'},\n",
       "    {'title': '产品图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a18250cbf88cdc619e2cd4b46431a95e'}],\n",
       "   'typecode': '050300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '麦香基(西宁店)',\n",
       "   'location': '113.587675,23.550714',\n",
       "   'tel': '020-87926656',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140MFVH'},\n",
       "  {'parent': [],\n",
       "   'address': '新城市场斜对面农行隔壁',\n",
       "   'distance': '12703',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '13.00',\n",
       "    'opentime2': [],\n",
       "    'rating': '4.4',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/9abfc542aab94d3acee68e53c4897f71'}],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '得道正果云吞(西宁店)',\n",
       "   'location': '113.586450,23.551371',\n",
       "   'tel': '13926116800',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140A44F'},\n",
       "  {'parent': [],\n",
       "   'address': '街口西宁西路25号(卓诗妮旁)',\n",
       "   'distance': '12752',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '4.1',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a5b9a5c4f6d1bc3f08aef68abebac266'},\n",
       "    {'title': '炒苦螺',\n",
       "     'url': 'https://img.alicdn.com/imgextra/i1/2201060279735/O1CN01LdkcRA2LmgI6E5bBN_!!2201060279735-0-koubei.jpg'},\n",
       "    {'title': '炒油菜',\n",
       "     'url': 'https://img.alicdn.com/imgextra/i1/2201122505308/O1CN01195hRN1p56uOaXpkV_!!2201122505308-0-koubei.jpg'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '168肠粉皇(新村北路)',\n",
       "   'location': '113.585246,23.551947',\n",
       "   'tel': '13533398028',\n",
       "   'shopid': [],\n",
       "   'id': 'B0GK1ZXI1L'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁横街68号',\n",
       "   'distance': '12756',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.4',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '樊易林云吞饺子(西宁店)',\n",
       "   'location': '113.588207,23.548949',\n",
       "   'tel': '020-37501036',\n",
       "   'shopid': [],\n",
       "   'id': 'B0HRVOF5ZQ'},\n",
       "  {'parent': [],\n",
       "   'address': '街口江埔街七星西路5号',\n",
       "   'distance': '12814',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55b5cf2aa31058fe016cf060'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/024653057739a0e19d3b779a759316c8'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '心意(七星路店)',\n",
       "   'location': '113.596222,23.541256',\n",
       "   'tel': '13768871996',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFF3UXBH'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁西路122号',\n",
       "   'distance': '12848',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.4',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '潮味猪杂汤粉世家',\n",
       "   'location': '113.583517,23.552420',\n",
       "   'tel': '18028212807',\n",
       "   'shopid': [],\n",
       "   'id': 'B0IGJ5Q2GK'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁西路204号',\n",
       "   'distance': '12898',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '4.5',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'https://img.alicdn.com/imgextra/i2/3695320962/O1CN01AJZltn1Iydi2epQby_!!3695320962-0-kbcontentapng.jpg'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '西城饮食店',\n",
       "   'location': '113.582226,23.553099',\n",
       "   'tel': '15013321618',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140K35E'},\n",
       "  {'parent': [],\n",
       "   'address': '城郊街新城西路10号',\n",
       "   'distance': '12956',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '22.00',\n",
       "    'opentime2': '周一至周五09:00-20:00,周六至周日10:00-22:00',\n",
       "    'rating': '4.0',\n",
       "    'open_time': '09:00-20:00 10:00-22:00',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5aba83dfa5275a1c02978d984c692925'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0145816b6de9b1a14d2b6178a9e3f6fc'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/04b71e7bca60bbb9917d86bf257c80fb'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '港岛记香港叉烧饭(新城西路店)',\n",
       "   'location': '113.581492,23.553085',\n",
       "   'tel': '13534348798',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2AODVQC'},\n",
       "  {'parent': [],\n",
       "   'address': '新城西路68号妇幼保健院旁',\n",
       "   'distance': '12976',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '14.00',\n",
       "    'opentime2': '08:00-22:00',\n",
       "    'rating': '4.0',\n",
       "    'open_time': '08:00-22:00',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55b5b430a31058fe016aa69b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55b5b430a31058fe016aa69d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/1e1956c3d833900e137144d01edfd9eb'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '潮汕隆江猪脚饭(城郊分店)',\n",
       "   'location': '113.580424,23.553815',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFRHNPE'},\n",
       "  {'parent': [],\n",
       "   'address': '新城西路关围新村',\n",
       "   'distance': '13020',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/c288506e380f3195389a9e819bf471a0'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '标仔美食店',\n",
       "   'location': '113.579444,23.554402',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0GKOZ7ZDZ'},\n",
       "  {'parent': [],\n",
       "   'address': '西宁西路70号',\n",
       "   'distance': '13088',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.8',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4a1277ad003b04846b286cb7b6f2b4d3'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '联兴牛腩粉面(塘圈路店)',\n",
       "   'location': '113.576924,23.556252',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFWWY4R'},\n",
       "  {'parent': [],\n",
       "   'address': '新城西路145号',\n",
       "   'distance': '13135',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': '17:00-03:30',\n",
       "    'rating': '4.4',\n",
       "    'open_time': '17:00-03:30',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/02fa865b785f744785de614ae4e2b8f7'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/371e6a434a530adc462e23b8a64f524d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/48f8e4effd95939257e0b7625a0bd4dc'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '雷米猪杂粥(第三分店)',\n",
       "   'location': '113.577114,23.555422',\n",
       "   'tel': '18664883031',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFWXHHB'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "8d39b831",
   "metadata": {},
   "outputs": [],
   "source": [
    "around_url = 'https://restapi.amap.com/v3/place/around?parameters'\n",
    "\n",
    "payload = {\n",
    "    \"key\":\"dfebacc3a57966864984891dbfaddeee\",\n",
    "    \"location\":广州南方学院_location,\n",
    "    \"types\":\"050100\",\n",
    "    'page':2\n",
    "}\n",
    "r = requests.get(around_url,params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "b1fde7d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '244',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉镇中大南方学院',\n",
       "   'distance': '359',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '食再添(中大店)',\n",
       "   'location': '113.676568,23.631259',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0HROCK40Y'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中大南方学院',\n",
       "   'distance': '359',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '深海一只鱼(中大店)',\n",
       "   'location': '113.676568,23.631259',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0HRO7KVZA'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中大南方',\n",
       "   'distance': '359',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '莹香美食',\n",
       "   'location': '113.676568,23.631259',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0H1MR1AGD'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中大南方',\n",
       "   'distance': '359',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '麻辣香锅木桶饭',\n",
       "   'location': '113.676568,23.631259',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2GMNM5K'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中大南方学院',\n",
       "   'distance': '359',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '0.6',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '鱼诱(中大店)',\n",
       "   'location': '113.676568,23.631259',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL7MCT2'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院综合楼',\n",
       "   'distance': '388',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '王牌烤肉拌饭',\n",
       "   'location': '113.680126,23.631492',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0H1M7YDQH'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031',\n",
       "   'distance': '408',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '猪杂汤饭',\n",
       "   'location': '113.676500,23.631722',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3FCLIZ4'},\n",
       "  {'parent': [],\n",
       "   'address': '博学路与中山路交叉口南360米',\n",
       "   'distance': '432',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '大可鱼酸菜鱼米饭',\n",
       "   'location': '113.675820,23.631603',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3F5KULC'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院博学路6号',\n",
       "   'distance': '450',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': '每天06:30-22:00',\n",
       "    'rating': '4.4',\n",
       "    'open_time': '06:30-22:00',\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2c37d66c4839faf438a9a382d3ec507f'}],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '广州南方学院第一食堂',\n",
       "   'location': '113.676084,23.632024',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIXV3OZ'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心三楼3F-031',\n",
       "   'distance': '450',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '2.2',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '精品沙县(中大店)',\n",
       "   'location': '113.676059,23.631942',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3AOJXUX'},\n",
       "  {'parent': [],\n",
       "   'address': '博学路4附近',\n",
       "   'distance': '466',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.6',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '广州南方学院西区饭堂',\n",
       "   'location': '113.676210,23.632177',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0HGD57SV2'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'distance': '471',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '湘味小厨',\n",
       "   'location': '113.679283,23.632572',\n",
       "   'tel': '13005184390',\n",
       "   'shopid': [],\n",
       "   'id': 'B0GKHC2KQN'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'distance': '471',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '东记乡村美食',\n",
       "   'location': '113.679283,23.632572',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3APADKJ'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'distance': '485',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '老地方乐山油炸串串',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0H6Y1AW1Y'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'distance': '485',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '港渝好粥道',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0H64DILIJ'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24中山大学南方学院商业中心一楼007号',\n",
       "   'distance': '485',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.5',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '杨国福麻辣烫(中大南方学院店)',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0H1MRZ4H9'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院明辩路2号',\n",
       "   'distance': '485',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '耀记美食',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0GRGOTLSL'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'distance': '485',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '陈记鱼庄',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': '19820396588',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3AGA9GN'},\n",
       "  {'parent': [],\n",
       "   'address': '南方学院',\n",
       "   'distance': '697',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': '3.3',\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '广州南方学院第五食堂',\n",
       "   'location': '113.679234,23.634647',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0HGD57LEK'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇桃园西路3号(随便公寓旁)',\n",
       "   'distance': '744',\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [],\n",
       "    'opentime2': [],\n",
       "    'rating': [],\n",
       "    'open_time': [],\n",
       "    'meal_ordering': '0'},\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '古炎燒便当(中大店)',\n",
       "   'location': '113.680114,23.621967',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0HROCMS19'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "800926a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "43983d8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>infocode</th>\n",
       "      <th>pois</th>\n",
       "      <th>status</th>\n",
       "      <th>info</th>\n",
       "      <th>suggestion.keywords</th>\n",
       "      <th>suggestion.cities</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>244</td>\n",
       "      <td>10000</td>\n",
       "      <td>[{'parent': [], 'address': '温泉镇中大南方学院', 'dista...</td>\n",
       "      <td>1</td>\n",
       "      <td>OK</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  count infocode                                               pois status  \\\n",
       "0   244    10000  [{'parent': [], 'address': '温泉镇中大南方学院', 'dista...      1   \n",
       "\n",
       "  info suggestion.keywords suggestion.cities  \n",
       "0   OK                  []                []  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3e10bfda",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
